﻿#ifndef PICKARMCONFIG_H
#define PICKARMCONFIG_H

#include "configManager/configobject.h"
#include "configManager/configobjectarray.h"

class PickArmConfig : public ConfigObject
{
    Q_OBJECT
    Q_PROPERTY(double picker1ToCameraOffsetX READ picker1ToCameraOffsetX WRITE setPicker1ToCameraOffsetX NOTIFY picker1ToCameraOffsetXChanged)
    Q_PROPERTY(double picker1ToCameraOffsetY READ picker1ToCameraOffsetY WRITE setPicker1ToCameraOffsetY NOTIFY picker1ToCameraOffsetYChanged)
    Q_PROPERTY(double picker2ToCameraOffsetX READ picker2ToCameraOffsetX WRITE setPicker2ToCameraOffsetX NOTIFY picker2ToCameraOffsetXChanged)
    Q_PROPERTY(double picker2ToCameraOffsetY READ picker2ToCameraOffsetY WRITE setPicker2ToCameraOffsetY NOTIFY picker2ToCameraOffsetYChanged)

    Q_PROPERTY(double pickSensorOffsetX READ pickSensorOffsetX WRITE setPickSensorOffsetX NOTIFY pickSensorOffsetXChanged)
    Q_PROPERTY(double pickSensorOffsetY READ pickSensorOffsetY WRITE setPickSensorOffsetY NOTIFY pickSensorOffsetYChanged)

    Q_PROPERTY(int corCaliStepCount READ corCaliStepCount WRITE setCorCaliStepCount NOTIFY corCaliStepCountChanged)
    Q_PROPERTY(double corCaliStepSize READ corCaliStepSize WRITE setCorCaliStepSize NOTIFY corCaliStepSizeChanged)

    Q_PROPERTY(bool isDryRun READ isDryRun WRITE setIsDryRun NOTIFY isDryRunChanged)
    Q_PROPERTY(bool rejectUseSoftLand READ rejectUseSoftLand WRITE setRejectUseSoftLand NOTIFY rejectUseSoftLandChanged)

    Q_PROPERTY(int delayOfterOpenVacuum READ delayOfterOpenVacuum WRITE setDelayOfterOpenVacuum NOTIFY delayOfterOpenVacuumChanged)
    Q_PROPERTY(int delayOfterCloseVacuum READ delayOfterCloseVacuum WRITE setDelayOfterCloseVacuum NOTIFY delayOfterCloseVacuumChanged)

    Q_PROPERTY(int currentRejectTrayUnitRowIndex READ currentRejectTrayUnitRowIndex WRITE setCurrentRejectTrayUnitRowIndex NOTIFY currentRejectTrayUnitRowIndexChanged)
    Q_PROPERTY(int currentRejectTrayUnitColumnIndex READ currentRejectTrayUnitColumnIndex WRITE setCurrentRejectTrayUnitColumnIndex NOTIFY currentRejectTrayUnitColumnIndexChanged)
    Q_PROPERTY(int currentRejectTrayRowIndexInside READ currentRejectTrayRowIndexInside WRITE setCurrentRejectTrayRowIndexInside NOTIFY currentRejectTrayRowIndexInsideChanged)
    Q_PROPERTY(int currentRejectTrayColumnIndexInside READ currentRejectTrayColumnIndexInside WRITE setCurrentRejectTrayColumnIndexInside NOTIFY currentRejectTrayColumnIndexInsideChanged)

    Q_PROPERTY(int currentPickSenserUnitRowIndex READ currentPickSenserUnitRowIndex WRITE setCurrentPickSenserUnitRowIndex NOTIFY currentPickSenserUnitRowIndexChanged)
    Q_PROPERTY(int currentPickSenserUnitColumnIndex READ currentPickSenserUnitColumnIndex WRITE setCurrentPickSenserUnitColumnIndex NOTIFY currentPickSenserUnitColumnIndexChanged)
    Q_PROPERTY(int currentPickSenserRowIndexInside READ currentPickSenserRowIndexInside WRITE setCurrentPickSenserRowIndexInside NOTIFY currentPickSenserRowIndexInsideChanged)
    Q_PROPERTY(int currentPickSenserColumnIndexInside READ currentPickSenserColumnIndexInside WRITE setCurrentPickSenserColumnIndexInside NOTIFY currentPickSenserColumnIndexInsideChanged)

    Q_PROPERTY(int currentPickLensUnitRowIndex READ currentPickLensUnitRowIndex WRITE setCurrentPickLensUnitRowIndex NOTIFY currentPickLensUnitRowIndexChanged)
    Q_PROPERTY(int currentPickLensUnitColumnIndex READ currentPickLensUnitColumnIndex WRITE setCurrentPickLensUnitColumnIndex NOTIFY currentPickLensUnitColumnIndexChanged)
    Q_PROPERTY(int currentPickLensRowIndexInside READ currentPickLensRowIndexInside WRITE setCurrentPickLensRowIndexInside NOTIFY currentPickLensRowIndexInsideChanged)
    Q_PROPERTY(int currentPickLensColumnIndexInside READ currentPickLensColumnIndexInside WRITE setCurrentPickLensColumnIndexInside NOTIFY currentPickLensColumnIndexInsideChanged)

    Q_PROPERTY(int currentPlaceProductUintRowIndex READ currentPlaceProductUintRowIndex WRITE setCurrentPlaceProductUintRowIndex NOTIFY currentPlaceProductUintRowIndexChanged)
    Q_PROPERTY(int currentPlaceProductUintColumnIndex READ currentPlaceProductUintColumnIndex WRITE setCurrentPlaceProductUintColumnIndex NOTIFY currentPlaceProductUintColumnIndexChanged)
    Q_PROPERTY(int currentPlaceProductRowIndexInside READ currentPlaceProductRowIndexInside WRITE setCurrentPlaceProductRowIndexInside NOTIFY currentPlaceProductRowIndexInsideChanged)
    Q_PROPERTY(int currentPlaceProductColumnIndexInside READ currentPlaceProductColumnIndexInside WRITE setCurrentPlaceProductColumnIndexInside NOTIFY currentPlaceProductColumnIndexInsideChanged)

    Q_PROPERTY(int currentPlaceNgLensUintRowIndex READ currentPlaceNgLensUintRowIndex WRITE setCurrentPlaceNgLensUintRowIndex NOTIFY currentPlaceNgLensUintRowIndexChanged)
    Q_PROPERTY(int currentPlaceNgLensUintColumnIndex READ currentPlaceNgLensUintColumnIndex WRITE setCurrentPlaceNgLensUintColumnIndex NOTIFY currentPlaceNgLensUintColumnIndexChanged)
    Q_PROPERTY(int currentPlaceNgLensRowIndexInside READ currentPlaceNgLensRowIndexInside WRITE setCurrentPlaceNgLensRowIndexInside NOTIFY currentPlaceNgLensRowIndexInsideChanged)
    Q_PROPERTY(int currentPlaceNgLensColumnIndexInside READ currentPlaceNgLensColumnIndexInside WRITE setCurrentPlaceNgLensColumnIndexInside NOTIFY currentPlaceNgLensColumnIndexInsideChanged)

    Q_PROPERTY(int planCount READ planCount WRITE setPlanCount NOTIFY planCountChanged)
    Q_PROPERTY(int finishedCount READ finishedCount WRITE setFinishedCount NOTIFY finishedCountChanged)

public:
    PickArmConfig(QObject *parent = nullptr) : ConfigObject(parent)
    {
        init();
    }
    double picker1ToCameraOffsetX() const
    {
        return m_picker1ToCameraOffsetX;
    }

    double picker1ToCameraOffsetY() const
    {
        return m_picker1ToCameraOffsetY;
    }

    double picker2ToCameraOffsetX() const
    {
        return m_picker2ToCameraOffsetX;
    }

    double picker2ToCameraOffsetY() const
    {
        return m_picker2ToCameraOffsetY;
    }

    int corCaliStepCount() const
    {
        return m_corCaliStepCount;
    }

    double corCaliStepSize() const
    {
        return m_corCaliStepSize;
    }

    int delayOfterOpenVacuum() const
    {
        return m_delayOfterOpenVacuum;
    }

    int delayOfterCloseVacuum() const
    {
        return m_delayOfterCloseVacuum;
    }

    bool isDryRun() const
    {
        return m_isDryRun;
    }

    int currentRejectTrayUnitRowIndex() const
    {
        return m_currentRejectTrayUnitRowIndex;
    }

    int currentRejectTrayUnitColumnIndex() const
    {
        return m_currentRejectTrayUnitColumnIndex;
    }

    int currentRejectTrayRowIndexInside() const
    {
        return m_currentRejectTrayRowIndexInside;
    }

    int currentRejectTrayColumnIndexInside() const
    {
        return m_currentRejectTrayColumnIndexInside;
    }

    int currentPickSenserUnitRowIndex() const
    {
        return m_currentPickSenserUnitRowIndex;
    }

    int currentPickSenserUnitColumnIndex() const
    {
        return m_currentPickSenserUnitColumnIndex;
    }

    int currentPickSenserRowIndexInside() const
    {
        return m_currentPickSenserRowIndexInside;
    }

    int currentPickSenserColumnIndexInside() const
    {
        return m_currentPickSenserColumnIndexInside;
    }

    int currentPickLensUnitRowIndex() const
    {
        return m_currentPickLensUnitRowIndex;
    }

    int currentPickLensUnitColumnIndex() const
    {
        return m_currentPickLensUnitColumnIndex;
    }

    int currentPickLensRowIndexInside() const
    {
        return m_currentPickLensRowIndexInside;
    }

    int currentPickLensColumnIndexInside() const
    {
        return m_currentPickLensColumnIndexInside;
    }

    int currentPlaceProductUintRowIndex() const
    {
        return m_currentPlaceProductUintRowIndex;
    }

    int currentPlaceProductUintColumnIndex() const
    {
        return m_currentPlaceProductUintColumnIndex;
    }

    int currentPlaceProductRowIndexInside() const
    {
        return m_currentPlaceProductRowIndexInside;
    }

    int currentPlaceProductColumnIndexInside() const
    {
        return m_currentPlaceProductColumnIndexInside;
    }

    int currentPlaceNgLensUintRowIndex() const
    {
        return m_currentPlaceNgLensUintRowIndex;
    }

    int currentPlaceNgLensUintColumnIndex() const
    {
        return m_currentPlaceNgLensUintColumnIndex;
    }

    int currentPlaceNgLensRowIndexInside() const
    {
        return m_currentPlaceNgLensRowIndexInside;
    }

    int currentPlaceNgLensColumnIndexInside() const
    {
        return m_currentPlaceNgLensColumnIndexInside;
    }

    double pickSensorOffsetX() const
    {
        return m_pickSensorOffsetX;
    }

    double pickSensorOffsetY() const
    {
        return m_pickSensorOffsetY;
    }

    bool rejectUseSoftLand() const
    {
        return m_rejectUseSoftLand;
    }

    int planCount() const
    {
        return m_planCount;
    }

    int finishedCount() const
    {
        return m_finishedCount;
    }

public slots:
    void setPicker1ToCameraOffsetX(double picker1ToCameraOffsetX)
    {
        //qWarning("Floating point comparison needs context sanity check");
        if (qFuzzyCompare(m_picker1ToCameraOffsetX, picker1ToCameraOffsetX))
            return;

        m_picker1ToCameraOffsetX = picker1ToCameraOffsetX;
        emit picker1ToCameraOffsetXChanged(m_picker1ToCameraOffsetX);
    }

    void setPicker1ToCameraOffsetY(double picker1ToCameraOffsetY)
    {
        //qWarning("Floating point comparison needs context sanity check");
        if (qFuzzyCompare(m_picker1ToCameraOffsetY, picker1ToCameraOffsetY))
            return;

        m_picker1ToCameraOffsetY = picker1ToCameraOffsetY;
        emit picker1ToCameraOffsetYChanged(m_picker1ToCameraOffsetY);
    }

    void setPicker2ToCameraOffsetX(double picker2ToCameraOffsetX)
    {
        //qWarning("Floating point comparison needs context sanity check");
        if (qFuzzyCompare(m_picker2ToCameraOffsetX, picker2ToCameraOffsetX))
            return;

        m_picker2ToCameraOffsetX = picker2ToCameraOffsetX;
        emit picker2ToCameraOffsetXChanged(m_picker2ToCameraOffsetX);
    }

    void setPicker2ToCameraOffsetY(double picker2ToCameraOffsetY)
    {
        //qWarning("Floating point comparison needs context sanity check");
        if (qFuzzyCompare(m_picker2ToCameraOffsetY, picker2ToCameraOffsetY))
            return;

        m_picker2ToCameraOffsetY = picker2ToCameraOffsetY;
        emit picker2ToCameraOffsetYChanged(m_picker2ToCameraOffsetY);
    }


    void setCorCaliStepCount(int corCaliStepCount)
    {
        if (m_corCaliStepCount == corCaliStepCount)
            return;

        m_corCaliStepCount = corCaliStepCount;
        emit corCaliStepCountChanged(m_corCaliStepCount);
    }

    void setCorCaliStepSize(double corCaliStepSize)
    {
        //qWarning("Floating point comparison needs context sanity check");
        if (qFuzzyCompare(m_corCaliStepSize, corCaliStepSize))
            return;

        m_corCaliStepSize = corCaliStepSize;
        emit corCaliStepSizeChanged(m_corCaliStepSize);
    }


    void setDelayOfterOpenVacuum(int delayOfterOpenVacuum)
    {
        if (m_delayOfterOpenVacuum == delayOfterOpenVacuum)
            return;

        m_delayOfterOpenVacuum = delayOfterOpenVacuum;
        emit delayOfterOpenVacuumChanged(m_delayOfterOpenVacuum);
    }

    void setDelayOfterCloseVacuum(int delayOfterCloseVacuum)
    {
        if (m_delayOfterCloseVacuum == delayOfterCloseVacuum)
            return;

        m_delayOfterCloseVacuum = delayOfterCloseVacuum;
        emit delayOfterCloseVacuumChanged(m_delayOfterCloseVacuum);
    }


    void setIsDryRun(bool isDryRun)
    {
        if (m_isDryRun == isDryRun)
            return;

        m_isDryRun = isDryRun;
        emit isDryRunChanged(m_isDryRun);
    }


    void setCurrentRejectTrayUnitRowIndex(int currentRejectTrayUnitRowIndex)
    {
        if (m_currentRejectTrayUnitRowIndex == currentRejectTrayUnitRowIndex)
            return;

        m_currentRejectTrayUnitRowIndex = currentRejectTrayUnitRowIndex;
        emit currentRejectTrayUnitRowIndexChanged(m_currentRejectTrayUnitRowIndex);
    }

    void selfAddRejectTrayUnitRowIndex()
    {
        m_currentRejectTrayUnitRowIndex ++;
        emit currentRejectTrayUnitRowIndexChanged(m_currentRejectTrayUnitRowIndex);
    }

    void setCurrentRejectTrayUnitColumnIndex(int currentRejectTrayUnitColumnIndex)
    {
        if (m_currentRejectTrayUnitColumnIndex == currentRejectTrayUnitColumnIndex)
            return;

        m_currentRejectTrayUnitColumnIndex = currentRejectTrayUnitColumnIndex;
        emit currentRejectTrayUnitColumnIndexChanged(m_currentRejectTrayUnitColumnIndex);
    }

    void selfAddRejectTrayUnitColumnIndex()
    {
        m_currentRejectTrayUnitColumnIndex ++;
        emit currentRejectTrayUnitColumnIndexChanged(m_currentRejectTrayUnitColumnIndex);
    }

    void setCurrentRejectTrayRowIndexInside(int currentRejectTrayRowIndexInside)
    {
        if (m_currentRejectTrayRowIndexInside == currentRejectTrayRowIndexInside)
            return;

        m_currentRejectTrayRowIndexInside = currentRejectTrayRowIndexInside;
        emit currentRejectTrayRowIndexInsideChanged(m_currentRejectTrayRowIndexInside);
    }

    void selfAddRejectTrayRowIndexInside()
    {
        m_currentRejectTrayRowIndexInside ++;
        emit currentRejectTrayRowIndexInsideChanged(m_currentRejectTrayRowIndexInside);
    }

    void setCurrentRejectTrayColumnIndexInside(int currentRejectTrayColumnIndexInside)
    {
        if (m_currentRejectTrayColumnIndexInside == currentRejectTrayColumnIndexInside)
            return;

        m_currentRejectTrayColumnIndexInside = currentRejectTrayColumnIndexInside;
        emit currentRejectTrayColumnIndexInsideChanged(m_currentRejectTrayColumnIndexInside);
    }

    void selfAddRejectTrayColumnIndexInside()
    {
        m_currentRejectTrayColumnIndexInside ++;
        emit currentRejectTrayColumnIndexInsideChanged(m_currentRejectTrayColumnIndexInside);
    }


    void setCurrentPickSenserUnitRowIndex(int currentPickSenserUnitRowIndex)
    {
        if (m_currentPickSenserUnitRowIndex == currentPickSenserUnitRowIndex)
            return;

        m_currentPickSenserUnitRowIndex = currentPickSenserUnitRowIndex;
        emit currentPickSenserUnitRowIndexChanged(m_currentPickSenserUnitRowIndex);
    }

    void selfAddPickSenserUnitRowIndex()
    {
        m_currentPickSenserUnitRowIndex ++;
        emit currentPickSenserUnitRowIndexChanged(m_currentPickSenserUnitRowIndex);
    }

    void setCurrentPickSenserUnitColumnIndex(int currentPickSenserUnitColumnIndex)
    {
        if (m_currentPickSenserUnitColumnIndex == currentPickSenserUnitColumnIndex)
            return;

        m_currentPickSenserUnitColumnIndex = currentPickSenserUnitColumnIndex;
        emit currentPickSenserUnitColumnIndexChanged(m_currentPickSenserUnitColumnIndex);
    }

    void selfAddPickSenserUnitColumnIndex()
    {
        m_currentPickSenserUnitColumnIndex ++;
        emit currentPickSenserUnitColumnIndexChanged(m_currentPickSenserUnitColumnIndex);
    }

    void setCurrentPickSenserRowIndexInside(int currentPickSenserRowIndexInside)
    {
        if (m_currentPickSenserRowIndexInside == currentPickSenserRowIndexInside)
            return;

        m_currentPickSenserRowIndexInside = currentPickSenserRowIndexInside;
        emit currentPickSenserRowIndexInsideChanged(m_currentPickSenserRowIndexInside);
    }

    void selfAddPickSenserRowIndexInside()
    {
        m_currentPickSenserRowIndexInside ++;
        emit currentPickSenserRowIndexInsideChanged(m_currentPickSenserRowIndexInside);
    }

    void setCurrentPickSenserColumnIndexInside(int currentPickSenserColumnIndexInside)
    {
        if (m_currentPickSenserColumnIndexInside == currentPickSenserColumnIndexInside)
            return;

        m_currentPickSenserColumnIndexInside = currentPickSenserColumnIndexInside;
        emit currentPickSenserColumnIndexInsideChanged(m_currentPickSenserColumnIndexInside);
    }

    void selfAddPickSenserColumnIndexInside()
    {
        m_currentPickSenserColumnIndexInside ++;
        emit currentPickSenserColumnIndexInsideChanged(m_currentPickSenserColumnIndexInside);
    }


    void setCurrentPickLensUnitRowIndex(int currentPickLensUnitRowIndex)
    {
        if (m_currentPickLensUnitRowIndex == currentPickLensUnitRowIndex)
            return;

        m_currentPickLensUnitRowIndex = currentPickLensUnitRowIndex;
        emit currentPickLensUnitRowIndexChanged(m_currentPickLensUnitRowIndex);
    }

    void selfAddPickLensUnitRowIndex()
    {
        m_currentPickLensUnitRowIndex ++;
        emit currentPickLensUnitRowIndexChanged(m_currentPickLensUnitRowIndex);
    }

    void setCurrentPickLensUnitColumnIndex(int currentPickLensUnitColumnIndex)
    {
        if (m_currentPickLensUnitColumnIndex == currentPickLensUnitColumnIndex)
            return;

        m_currentPickLensUnitColumnIndex = currentPickLensUnitColumnIndex;
        emit currentPickLensUnitColumnIndexChanged(m_currentPickLensUnitColumnIndex);
    }

    void selfAddPickLensUnitColumnIndex()
    {
        m_currentPickLensUnitColumnIndex ++;
        emit currentPickLensUnitColumnIndexChanged(m_currentPickLensUnitColumnIndex);
    }

    void setCurrentPickLensRowIndexInside(int currentPickLensRowIndexInside)
    {
        if (m_currentPickLensRowIndexInside == currentPickLensRowIndexInside)
            return;

        m_currentPickLensRowIndexInside = currentPickLensRowIndexInside;
        emit currentPickLensRowIndexInsideChanged(m_currentPickLensRowIndexInside);
    }

    void selfAddPickLensRowIndexInside()
    {
        m_currentPickLensRowIndexInside ++;
        emit currentPickLensRowIndexInsideChanged(m_currentPickLensRowIndexInside);
    }

    void setCurrentPickLensColumnIndexInside(int currentPickLensColumnIndexInside)
    {
        if (m_currentPickLensColumnIndexInside == currentPickLensColumnIndexInside)
            return;

        m_currentPickLensColumnIndexInside = currentPickLensColumnIndexInside;
        emit currentPickLensColumnIndexInsideChanged(m_currentPickLensColumnIndexInside);
    }

    void selfAddPickLensColumnIndexInside()
    {
        m_currentPickLensColumnIndexInside ++;
        emit currentPickLensColumnIndexInsideChanged(m_currentPickLensColumnIndexInside);
    }


    void setCurrentPlaceProductUintRowIndex(int currentPlaceProductUintRowIndex)
    {
        if (m_currentPlaceProductUintRowIndex == currentPlaceProductUintRowIndex)
            return;

        m_currentPlaceProductUintRowIndex = currentPlaceProductUintRowIndex;
        emit currentPlaceProductUintRowIndexChanged(m_currentPlaceProductUintRowIndex);
    }

    void selfAddPlaceProductUintRowIndex()
    {
        m_currentPlaceProductUintRowIndex ++;
        emit currentPlaceProductUintRowIndexChanged(m_currentPlaceProductUintRowIndex);
    }

    void setCurrentPlaceProductUintColumnIndex(int currentPlaceProductUintColumnIndex)
    {
        if (m_currentPlaceProductUintColumnIndex == currentPlaceProductUintColumnIndex)
            return;

        m_currentPlaceProductUintColumnIndex = currentPlaceProductUintColumnIndex;
        emit currentPlaceProductUintColumnIndexChanged(m_currentPlaceProductUintColumnIndex);
    }

    void selfAddPlaceProductUintColumnIndex()
    {
        m_currentPlaceProductUintColumnIndex ++;
        emit currentPlaceProductUintColumnIndexChanged(m_currentPlaceProductUintColumnIndex);
    }

    void setCurrentPlaceProductRowIndexInside(int currentPlaceProductRowIndexInside)
    {
        if (m_currentPlaceProductRowIndexInside == currentPlaceProductRowIndexInside)
            return;

        m_currentPlaceProductRowIndexInside = currentPlaceProductRowIndexInside;
        emit currentPlaceProductRowIndexInsideChanged(m_currentPlaceProductRowIndexInside);
    }

    void selfAddPlaceProductRowIndexInside()
    {
        m_currentPlaceProductRowIndexInside ++;
        emit currentPlaceProductRowIndexInsideChanged(m_currentPlaceProductRowIndexInside);
    }

    void setCurrentPlaceProductColumnIndexInside(int currentPlaceProductColumnIndexInside)
    {
        if (m_currentPlaceProductColumnIndexInside == currentPlaceProductColumnIndexInside)
            return;

        m_currentPlaceProductColumnIndexInside = currentPlaceProductColumnIndexInside;
        emit currentPlaceProductColumnIndexInsideChanged(m_currentPlaceProductColumnIndexInside);
    }

    void selfAddPlaceProductColumnIndexInside()
    {
        m_currentPlaceProductColumnIndexInside ++;
        emit currentPlaceProductColumnIndexInsideChanged(m_currentPlaceProductColumnIndexInside);
    }


    void setCurrentPlaceNgLensUintRowIndex(int currentPlaceNgLensUintRowIndex)
    {
        if (m_currentPlaceNgLensUintRowIndex == currentPlaceNgLensUintRowIndex)
            return;

        m_currentPlaceNgLensUintRowIndex = currentPlaceNgLensUintRowIndex;
        emit currentPlaceNgLensUintRowIndexChanged(m_currentPlaceNgLensUintRowIndex);
    }

    void selfAddPlaceNgLensUintRowIndex()
    {
        m_currentPlaceNgLensUintRowIndex ++;
        emit currentPlaceNgLensUintRowIndexChanged(m_currentPlaceNgLensUintRowIndex);
    }

    void setCurrentPlaceNgLensUintColumnIndex(int currentPlaceNgLensUintColumnIndex)
    {
        if (m_currentPlaceNgLensUintColumnIndex == currentPlaceNgLensUintColumnIndex)
            return;

        m_currentPlaceNgLensUintColumnIndex = currentPlaceNgLensUintColumnIndex;
        emit currentPlaceNgLensUintColumnIndexChanged(m_currentPlaceNgLensUintColumnIndex);
    }

    void selfAddPlaceNgLensUintColumnIndex()
    {
        m_currentPlaceNgLensUintColumnIndex ++;
        emit currentPlaceNgLensUintColumnIndexChanged(m_currentPlaceNgLensUintColumnIndex);
    }

    void setCurrentPlaceNgLensRowIndexInside(int currentPlaceNgLensRowIndexInside)
    {
        if (m_currentPlaceNgLensRowIndexInside == currentPlaceNgLensRowIndexInside)
            return;

        m_currentPlaceNgLensRowIndexInside = currentPlaceNgLensRowIndexInside;
        emit currentPlaceNgLensRowIndexInsideChanged(m_currentPlaceNgLensRowIndexInside);
    }

    void selfAddPlaceNgLensRowIndexInside()
    {
        m_currentPlaceNgLensRowIndexInside ++;
        emit currentPlaceNgLensRowIndexInsideChanged(m_currentPlaceNgLensRowIndexInside);
    }

    void setCurrentPlaceNgLensColumnIndexInside(int currentPlaceNgLensColumnIndexInside)
    {
        if (m_currentPlaceNgLensColumnIndexInside == currentPlaceNgLensColumnIndexInside)
            return;

        m_currentPlaceNgLensColumnIndexInside = currentPlaceNgLensColumnIndexInside;
        emit currentPlaceNgLensColumnIndexInsideChanged(m_currentPlaceNgLensColumnIndexInside);
    }

    void selfAddPlaceNgLensColumnIndexInside()
    {
        m_currentPlaceNgLensColumnIndexInside ++;
        emit currentPlaceNgLensColumnIndexInsideChanged(m_currentPlaceNgLensColumnIndexInside);
    }

    void setPickSensorOffsetX(double pickSensorOffsetX)
    {
        qWarning("Floating point comparison needs context sanity check");
        if (qFuzzyCompare(m_pickSensorOffsetX, pickSensorOffsetX))
            return;

        m_pickSensorOffsetX = pickSensorOffsetX;
        emit pickSensorOffsetXChanged(m_pickSensorOffsetX);
    }

    void setPickSensorOffsetY(double pickSensorOffsetY)
    {
        qWarning("Floating point comparison needs context sanity check");
        if (qFuzzyCompare(m_pickSensorOffsetY, pickSensorOffsetY))
            return;

        m_pickSensorOffsetY = pickSensorOffsetY;
        emit pickSensorOffsetYChanged(m_pickSensorOffsetY);
    }

    void setRejectUseSoftLand(bool rejectUseSoftLand)
    {
        if (m_rejectUseSoftLand == rejectUseSoftLand)
            return;

        m_rejectUseSoftLand = rejectUseSoftLand;
        emit rejectUseSoftLandChanged(m_rejectUseSoftLand);
    }

    void setPlanCount(int planCount)
    {
        if (m_planCount == planCount)
            return;

        m_planCount = planCount;
        emit planCountChanged(m_planCount);
    }

    void setFinishedCount(int finishedCount)
    {
        if (m_finishedCount == finishedCount)
            return;

        m_finishedCount = finishedCount;
        emit finishedCountChanged(m_finishedCount);
    }

    void selfAddFinishedCount()
    {
        m_finishedCount ++;
        emit finishedCountChanged(m_finishedCount);
    }

signals:
    void picker1ToCameraOffsetXChanged(double picker1ToCameraOffsetX);

    void picker1ToCameraOffsetYChanged(double picker1ToCameraOffsetY);

    void picker2ToCameraOffsetXChanged(double picker2ToCameraOffsetX);

    void picker2ToCameraOffsetYChanged(double picker2ToCameraOffsetY);


    void corCaliStepCountChanged(int corCaliStepCount);

    void corCaliStepSizeChanged(double corCaliStepSize);


    void delayOfterOpenVacuumChanged(int delayOfterOpenVacuum);

    void delayOfterCloseVacuumChanged(int delayOfterCloseVacuum);


    void rejectTrayOffsetXChanged(double rejectTrayOffsetX);

    void rejectTrayOffsetYChanged(double rejectTrayOffsetY);


    void isDryRunChanged(bool isDryRun);


    void currentRejectTrayUnitRowIndexChanged(int currentRejectTrayUnitRowIndex);

    void currentRejectTrayUnitColumnIndexChanged(int currentRejectTrayUnitColumnIndex);

    void currentRejectTrayRowIndexInsideChanged(int currentRejectTrayRowIndexInside);

    void currentRejectTrayColumnIndexInsideChanged(int currentRejectTrayColumnIndexInside);


    void currentPickSenserUnitRowIndexChanged(int currentPickSenserUnitRowIndex);

    void currentPickSenserUnitColumnIndexChanged(int currentPickSenserUnitColumnIndex);

    void currentPickSenserRowIndexInsideChanged(int currentPickSenserRowIndexInside);

    void currentPickSenserColumnIndexInsideChanged(int currentPickSenserColumnIndexInside);


    void currentPickLensUnitRowIndexChanged(int currentPickLensUnitRowIndex);

    void currentPickLensUnitColumnIndexChanged(int currentPickLensUnitColumnIndex);

    void currentPickLensRowIndexInsideChanged(int currentPickLensRowIndexInside);

    void currentPickLensColumnIndexInsideChanged(int currentPickLensColumnIndexInside);


    void currentPlaceProductUintRowIndexChanged(int currentPlaceProductUintRowIndex);

    void currentPlaceProductUintColumnIndexChanged(int currentPlaceProductUintColumnIndex);

    void currentPlaceProductRowIndexInsideChanged(int currentPlaceProductRowIndexInside);

    void currentPlaceProductColumnIndexInsideChanged(int currentPlaceProductColumnIndexInside);


    void currentPlaceNgLensUintRowIndexChanged(int currentPlaceNgLensUintRowIndex);

    void currentPlaceNgLensUintColumnIndexChanged(int currentPlaceNgLensUintColumnIndex);

    void currentPlaceNgLensRowIndexInsideChanged(int currentPlaceNgLensRowIndexInside);

    void currentPlaceNgLensColumnIndexInsideChanged(int currentPlaceNgLensColumnIndexInside);

    void pickSensorOffsetXChanged(double pickSensorOffsetX);

    void pickSensorOffsetYChanged(double pickSensorOffsetY);

    void rejectUseSoftLandChanged(bool rejectUseSoftLand);

    void planCountChanged(int planCount);

    void finishedCountChanged(int finishedCount);

private:
    double m_picker1ToCameraOffsetX = 0;
    double m_picker1ToCameraOffsetY = 0;
    double m_picker2ToCameraOffsetX = 0;
    double m_picker2ToCameraOffsetY = 0;

    int m_corCaliStepCount = 4;
    double m_corCaliStepSize = 4;

    int m_delayOfterOpenVacuum = 500;
    int m_delayOfterCloseVacuum = 500;

    bool m_isDryRun = false;
    bool m_rejectUseSoftLand = true;

    int m_currentRejectTrayUnitRowIndex =1;
    int m_currentRejectTrayUnitColumnIndex =1;
    int m_currentRejectTrayRowIndexInside =1;
    int m_currentRejectTrayColumnIndexInside =1;

    int m_currentPickSenserUnitRowIndex =1;
    int m_currentPickSenserUnitColumnIndex =1;
    int m_currentPickSenserRowIndexInside =1;
    int m_currentPickSenserColumnIndexInside =1;

    int m_currentPickLensUnitRowIndex =1;
    int m_currentPickLensUnitColumnIndex =1;
    int m_currentPickLensRowIndexInside =1;
    int m_currentPickLensColumnIndexInside =1;

    int m_currentPlaceProductUintRowIndex =1;
    int m_currentPlaceProductUintColumnIndex =1;
    int m_currentPlaceProductRowIndexInside =1;
    int m_currentPlaceProductColumnIndexInside =1;

    int m_currentPlaceNgLensUintRowIndex =1;
    int m_currentPlaceNgLensUintColumnIndex =1;
    int m_currentPlaceNgLensRowIndexInside =1;
    int m_currentPlaceNgLensColumnIndexInside =1;

    double m_pickSensorOffsetX =0;
    double m_pickSensorOffsetY = 0;

    int m_planCount = 1;
    int m_finishedCount = 0;
};

#endif // PICKARMCONFIG_H
